//Time class by mgm A.2
#include "Time.h"

Time::Time(int hh, int mm)
:h(hh),m(mm)
{
        if(!is_time(hh,mm)) throw Invalid();
}

Time& Time::default_time()
{
        static Time hh(0, 0);
        return hh;
}

Time::Time()
:h(default_time().hour()),
m(default_time().minute())
{
}

bool Time::is_time(int h, int m)
{
        //h: 0-23, m: 0-59
        return (h >= 0 && h <= 23 && m >= 0 && m <= 59);
}
